<?php //$Id

/**
 * This file defines de main slides configuration form
 * It uses the standard core Moodle (>1.8) formslib. For
 * more info about them, please visit:
 * 
 * http://docs.moodle.org/en/Development:lib/formslib.php
 *
 * The form must provide support for, at least these fields:
 *   - name: text element of 64cc max
 *
 * Also, it's usual to use these fields:
 *   - intro: one htmlarea element to describe the activity
 *            (will be showed in the list of activities of
 *             emboodle type (index.php) and in the header 
 *             of the emboodle main page (view.php).
 *   - introformat: The format used to write the contents
 *             of the intro field. It automatically defaults 
 *             to HTML when the htmleditor is used and can be
 *             manually selected if the htmleditor is not used
 *             (standard formats are: MOODLE, HTML, PLAIN, MARKDOWN)
 *             See lib/weblib.php Constants and the format_text()
 *             function for more info
 */

require_once ('moodleform_mod.php');
//include_once 'SSUtil/SSUtil.php';
//include_once 'embood.php';
//include_once 'emboodfetcher.php';

?>
<meta HTTP-EQUIV="Expires" content="27 Aug 2007 00:00:00 GMT" />
<meta HTTP-EQUIV="Cache-Control" content="no-cache" />
<LINK href="../mod/emboodle/emboodle.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&2.7.0/build/connection/connection-min.js&2.7.0/build/json/json-min.js"></script>
<script type="text/javascript" src="../mod/emboodle/emboodle_form.js"></script>


<?php
class mod_emboodle_mod_form extends moodleform_mod {
	
	function definition() {
		global $COURSE;
		$mform   = $this->_form;
 		//----------
 		$mform->addElement('hidden','warningplaceholder');
		     
      
        //TODO: remove placeholder, and grading buttons
        $mform->addElement('hidden','placeholder');
          $mform->addElement('text', 
							'intro',
							get_string('emboodle_user_desc', 'emboodle'), 
							array('size'=>'64'));	
  		$mform->addElement('text', 
							'link',
							get_string('emboodle_link', 'emboodle'), 
							array('size'=>'64','id'=>'id_link'));					
		$mform->addElement('hidden', 
							'name',
							get_string('emboodle_title', 'emboodle'), 
							array('size'=>'64','id'=> 'id_name'));
		$mform->addElement('hidden', 
							'authordesc',
							get_string('emboodle', 'emboodle'), 
							array('size'=>'64','id'=> 'id_authordesc'));
		$mform->addElement('html', 
				'<div id="uber_container" style="display:none"> ' .
				'	<img id="emboodle_loading" src="../mod/emboodle/ajax-loader.gif"/>' .
				'	<span id="emboodle_container"> ' .
				'	<div id="title_container">' .
				'	<span id="emboodle_title"></span><img id="emboodle_close" src="../mod/emboodle/close.png"/>' .
				'	</div>' .
				'	<div id="embedcontainer"></div> ' .
				'	<div id="authordesccontainer"></span></div> ' .
				'</div>');
        $mform->addElement('hidden','embedcode' , '', "id=id_embedcode");
 		
 		$mform->setType('name', PARAM_TEXT);
		$mform->addRule('intro', null, 'required', null, 'client');	
		
 		//------------------------------------------------------------------------------
 		// add standard buttons, common to all modules    
        $includeGroups=false;
		$this->standard_coursemodule_elements($includeGroups);
        $this->add_action_buttons();
	}	
}

?>




